<?php

if (!empty($this->category))
    $headerText = str_replace('##CATEGORY##', $this->category, $this->getCibleText('header_edit_'.$this->cleaction.'_text'));
else
    $headerText = $this->getCibleText('header_edit_'.$this->cleaction.'_text');

echo $this->partial('partials/header.pageDetails.phtml', array(
    'pageTitle' => $headerText,
    'pageDescription' => $this->getCibleText('header_edit_'.$this->cleaction.'_description'),
    'breadcrumb' => ''
));
;
?>
<div id="default_form">
    <div id="form_panel">
        <?php echo($this->form);?>
    </div>
</div>
<div class="" id="parameters">
    <ul id="tablesSrc" class="tablesConnected">
        <?php foreach ($this->modules as $module):?>
            <?php $idVal = $module['M_MVCModuleTitle'] . '-' . $module['M_ID']; ?>
        <li id="<?php echo $idVal; ?>" class="tableItem moduleItem">
            <p class="moduleTitle closed"><?php echo $module['M_Title']; ?></p>
            <?php if (!empty($module['fields'])): ?>
            <ul id="fieldsSrc" class="fieldsConnected" style="display: none;">
                <?php foreach ($module['fields'] as $index => $field):?>
                    <?php $idVal = $index; ?>
                    <li id="<?php echo $idVal; ?>" class="tableItem column">
                        <span class="label"><?php echo $this->getCibleText('form_label_' . $index); ?></span>
                    </li>
                <?php endforeach; ?>
            </ul>
            <?php endif; ?>
        </li>
        <?php endforeach; ?>
    </ul>
    <ul id="tablesSelec" class="tablesConnected"></ul>
</div>
<label class="dispLabel hidden"><?php echo $this->getCibleText('field_to_display_label'); ?></label>
<input type="checkbox" class="chkDisplay options hidden" value="" checked="checked" title="<?php echo $this->getCibleText('field_to_display'); ?>" />
<label class="filterLabel hidden"><?php echo $this->getCibleText('field_to_filter_label'); ?></label>
<input type="checkbox" class="chkFilters options hidden" value="" title="<?php echo $this->getCibleText('field_to_filter'); ?>" />
<?php echo '';?>
<script type="text/javascript">
    //<![CDATA[
    $(document).ready(function(){
        $().reports({
            id: <?php echo $this->id; ?>,
            baseUrl: '<?php echo $this->BaseUrl(); ?>',
            urlAction: '<?php echo $this->request->getPathInfo(); ?>'
        });
    });
    //]]>
</script>